package AB;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Zuoye1 {
    public static void main(String[] args) {
        Calendar c= Calendar.getInstance();
        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
        c.set(2017,06,12);
        Date d=c.getTime();
        String s=sim.format(d);
        System.out.println("商品生产日期："+s);
        c.add(Calendar.YEAR,5);
        Date d1=c.getTime();
        String s1=sim.format(d1);
        System.out.println("商品失效日期："+s1);
    }
}
